package com.example.spring.boot.repository.user;

import com.example.spring.boot.business.user.UserModel;

public class UserEntity {
    long userId;
    String userName;
    String password;
    long createTime ;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public static UserEntity createBy(UserModel userModel){
        UserEntity userEntity = new UserEntity();
        userEntity.setUserName(userModel.getUserName());
        userEntity.setPassword(userModel.getPassword());
        userEntity.setCreateTime(System.currentTimeMillis());
        return userEntity;
    }
}
